'''
-*- coding: utf-8 -*-
@File  : v8_det_openvino_only.py
@Author: Shanmh
@Time  : 2024/03/19 下午3:31
@Function：
'''
from tools.detection import Detection
import cv2
import time

if __name__ == '__main__':
    detecter=Detection("./models/yolov8s.pt")
    detecter.init_()
    # img=cv2.imread("/home/hxzh/Dataset/WaterDrop/dataset0311/images/train/20240311105903_water_194404.jpg")
    img=cv2.imread("asset/images/person.png")
    img=cv2.cvtColor(img,cv2.COLOR_BGR2RGB)

    st_time=time.time()
    test_count=1000
    for i in range(test_count):
        show,result=detecter.detect(img.copy())
        # print(result,len(result["det"]))
        # print(show.shape)
        # cv2.imshow("a",show)
        # cv2.waitKey(1)
    print(f"calculate 100 images spend {time.time()-st_time} ; speed: {test_count/(time.time()-st_time)}/s")
